<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>滚动条</title>
    <link rel="stylesheet" href="./css/basic.css" />
    <style>
      .container {
        width: 300px;
        height: 300px;
        background-color: pink;
        /* 父相子绝，相对定位占据原来位置，绝对定位不占据原来位置(置空) */
        position: relative;
      }

      .container_item1,
      .container_item2,
      .container_item3,
      .container_item4,
      .container_item5,
      .container_item6,
      .container_item7,
      .container_item8,
      .container_item9 {
        width: 50px;
        height: 50px;
        position: absolute;
      }
      .container_item1 {
        background-color: red;
      }
      .container_item2 {
        background-color: yellow;
        left: 50%;
        transform: translateX(-50%);
      }
      .container_item3 {
        background-color: blue;
        right: 0;

      }
      .container_item4 {
        background-color: green;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
      }
      .container_item5 {
        background-color: aqua;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
      }
      .container_item6 {
        background-color: darkkhaki;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
      }
      .container_item7 {
        background-color: palevioletred;
        bottom: 0;
      }
      .container_item8 {
        background-color: purple;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
      }
      .container_item9 {
        background-color: darkorange;
        bottom: 0;
        right: 0;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="container_item1"></div>
      <div class="container_item2"></div>
      <div class="container_item3"></div>
      <div class="container_item4"></div>
      <div class="container_item5"></div>
      <div class="container_item6"></div>
      <div class="container_item7"></div>
      <div class="container_item8"></div>
      <div class="container_item9"></div>
    </div>
  </body>
</html>
